home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 2984 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.4 KB

  1. Path: dartvax.dartmouth.edu!NewsWatcher!user
  2. From: Robert.Lendvai@dartmouth.edu (Robert Lendvai)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: class declaration question
  5. Date: Sun, 21 Jan 1996 01:26:28 -1000
  6. Organization: Dartmouth College
  7. Message-ID: <Robert.Lendvai-2101960127070001@129.170.80.94>
  8. References: <4dphp6$1bp@noc2.drexel.edu>
  9. NNTP-Posting-Host: atgw-kip-1-94.dartmouth.edu
  10.  
  11. In article <4dphp6$1bp@noc2.drexel.edu>, st918h5w@dunx1.ocs.drexel.edu
  12. (Jonathan Juniman) wrote:
  13.  
  14. > Is it necessary to do this:
  15. > class SomeClass
  16. >         {
  17. >         public:
  18. >         void Somefunction(int SomeParameter);
  19. >         }
  20. > or is it just as legal to do this:
  21. > class SomeClass
  22. >         {
  23. >         public:
  24. >         void SomeFunction(int);
  25. >         }
  26. > The latter seems to be the convention, but why does the compiler need to
  27. > know the name of SomeFunction's argument?  Isn't it sufficient to know the
  28. > type of Somefunction's argument (namely, int)?  
  29. > Please reply by e-mail.  PS; thanks to all the people who answered my
  30. > overloaded operator question.
  31. >                                         Jon
  32.  
  33. John,
  34.  
  35.    i think you need to go with the former (int SomeParameter). I'm not
  36. sure if the other way is legal, but even so, you need to know the name of
  37. the argument so that you may manipulate it in the function definition.
  38. Otherwise, how would you refer to the argument's value.
  39.